package com.softwinner.bt.util;

import java.util.HashMap;
import java.util.Map;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;

public class Utils {
	public static final String ACTION_BTSTATE_CHANGED="com.softwinner.bt.BTSTATE_CHANGED";
    public static final String ACTION_HANGUP="com.softwinner.bt.HANGUP";
    public static final String ACTION_GET_BTNAME="com.softwinner.bt.GET_BTNAME";
    public static final String ACTION_UPDATE_PAIRLIST="com.softwinner.bt.UPDATE_PAIRLIST";
    
    public static final String ACTION_PHONE_CALL="com.softwinner.bt.PHONE_CALL";
    public static final String ACTION_PHONE_COMING="com.softwinner.bt.PHONE_COMING";
    public static final String ACTION_PHONE_INCALL="com.softwinner.bt.PHONE_INCALL";
    
    public static final String ACTION_NEW_PHONE_CALL="com.softwinner.new.bt.phone_call";
    public static final String ACTION_NEW_PHONE_COMING="com.softwinner.new.bt.phone_coming";
    public static final String ACTION_NEW_PHONE_INCALL="com.softwinner.new.bt.phone_calling";
    
    public static final String ACTION_UPDATE_RECORDS="com.softwinner.bt.UPDATE_RECORDS";
    public static final String ACTION_UPDATE_CONTACTS="com.softwinner.bt.UPDATE_CONTACTS";
    public static final String ACTION_FINISH_CONTACTS="com.softwinner.bt.FINISH_CONTACTS";
    //audio manager
    public static final String AUDIOMANAGER_INTENT_ACTION_INTERRUPT_START="audiomanager.intent.action.INTERRUPT_START";
    public static final String AUDIOMANAGER_INTENT_ACTION_INTERRUPT_STOP="audiomanager.intent.action.INTERRUPT_STOP";
    public static final String AUDIOMANAGER_INTENT_ACTION_AIOS_START="audiomanager.intent.action.AIOS_START";
    public static final String AUDIOMANAGER_INTENT_ACTION_AIOS_STOP="audiomanager.intent.action.AIOS_STOP";
    public static final String AUDIOMANAGER_INTENT_ACTION_INSERT_START="audiomanager.intent.action.INSERT_START";
    public static final String AUDIOMANAGER_INTENT_ACTION_INSERT_STOP="audiomanager.intent.action.INSERT_STOP";
    public static final String AUDIOMANAGER_INTENT_MAP_TTS_UNMUTE="AUDIOMANAGER_INTENT_MAP_TTS_UNMUTE";
    public static final String AUDIOMANAGER_INTENT_MAP_TTS_MUTE="AUDIOMANAGER_INTENT_MAP_TTS_MUTE";
    
    /** MAPBAR action*/
    public static final String ACTION_NAVI_CALL_ECAR = "com_coagent_ecar_phone";
    /*aios send action*/
    public static final String AIOS_ANDROID_BT_GETBLTSTATUS="com.android.bt.getBLTStatus";
    
    public static void sendBroadcast(Context context,String action){
    	context.sendBroadcast(new Intent(action));
    }
    public static void sendBroadcast(Context context,String action,String number,String name){
    			Intent intent=new Intent(action);
    			intent.putExtra("number",number);
    			intent.putExtra("name",name);
    			context.sendBroadcast(intent);
    }
    private static Map<String, String> numMap = new HashMap<String, String>();    
    static{
    	numMap.put("10086", "移动客服");
    	numMap.put("10010", "联通客服");
    	numMap.put("4008005005", "翼卡客服");
    	numMap.put("075787807155", "翼卡客服");
		numMap.put("4008015170", "翼卡客服");
		numMap.put("075787807160", "翼卡客服");
    	numMap.put("10000", "电信客服");
    }
    
    public static String NameForNum(String num){
    	return numMap.get(num);
    }    
}
